# -*- coding: utf-8 -*- 
"""
@Author: 孟颖
@email: 652044581@qq.com
@date: 2023/4/23 10:03
@desc: 
"""
import time
from datetime import datetime, timedelta


class MyTime:
    dateTimeType = '%Y-%m-%d %H:%M:%S'
    dateType = '%Y-%m-%d'
    timeType = '%H:%M:%S'
    fileTimeType = "%Y%m%d%H%M%S%f"

    @staticmethod
    def TimeFormat(type=dateTimeType):
        return datetime.now().strftime(type)

    @staticmethod
    def timestampFormat(long=False):
        return int(time.time() * 1000) if long else int(time.time())

    @staticmethod
    def offsetFormat(start_time=datetime.now(), days=0, hour=0, minute=0, second=0, type=dateTimeType):
        offsetDateTime = start_time + timedelta(days=days, hours=hour, minutes=minute, seconds=second)
        return offsetDateTime.strftime(type)


if __name__ == '__main__':
    print(MyTime.TimeFormat(MyTime.fileTimeType))
